//
//  PlayerTool.h
//  MusicPlay
//
//  Created by lanou3g on 16/6/20.
//  Copyright © 2016年 xufeng. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import "FXXAudioSingleton.h"
@protocol PlayerToolDelegate <NSObject>
//开始播放了
- (void)startPlayOfUrl:(NSURL *)url;
//把当前播放的时间回调出去
- (void)getcurrentTime:(CGFloat)currentTime totalTime:(CGFloat)totalTime;
//播放结束
- (void)playendOfUrl:(NSURL *)url;

@end

@interface FXXPlayerTool : NSObject

single_interface(PlayerTool)
//播放器
@property (nonatomic, strong) AVPlayer *player;
//歌曲的url
@property (nonatomic, strong) NSURL *musicUrl;
//播放
- (void)play;
//暂停
- (void)pause;
//设置到某个时间开始播放
- (void)seekToTime:(NSInteger)time;
//设置音量
@property (nonatomic, assign) CGFloat volumeSlider;
//是否正在播放
@property (nonatomic, assign, getter=isPlaying, readonly) BOOL isPlaying;
//代理
@property (nonatomic, weak) id<PlayerToolDelegate> delegate;

@end

